/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package py.una.pol.ii.is2.domain.sistema;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author markos
 */
@Entity
@Table(name = "pantalla")
@NamedQueries({@NamedQuery(name = "Pantalla.findAll", query = "SELECT p FROM Pantalla p"), @NamedQuery(name = "Pantalla.findByPantNombre", query = "SELECT p FROM Pantalla p WHERE p.pantNombre = :pantNombre"), @NamedQuery(name = "Pantalla.findByPantAlias", query = "SELECT p FROM Pantalla p WHERE p.pantAlias = :pantAlias"), @NamedQuery(name = "Pantalla.findByPantDescripcion", query = "SELECT p FROM Pantalla p WHERE p.pantDescripcion = :pantDescripcion")})
public class Pantalla implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "pant_nombre")
    private String pantNombre;
    @Column(name = "pant_alias")
    private String pantAlias;
    @Column(name = "pant_descripcion")
    private String pantDescripcion;
    @OneToMany(cascade = CascadeType.MERGE, mappedBy = "pantalla")
    private Collection<PantRol> pantRolCollection;
    @JoinColumn(name = "pant_modulo", referencedColumnName = "modu_cod")
    @ManyToOne(optional = false)
    private Modulo pantModulo;

    public Pantalla() {
    }

    public Pantalla(String pantNombre) {
        this.pantNombre = pantNombre;
    }

    public String getPantNombre() {
        return pantNombre;
    }

    public void setPantNombre(String pantNombre) {
        this.pantNombre = pantNombre;
    }

    public String getPantAlias() {
        return pantAlias;
    }

    public void setPantAlias(String pantAlias) {
        this.pantAlias = pantAlias;
    }

    public String getPantDescripcion() {
        return pantDescripcion;
    }

    public void setPantDescripcion(String pantDescripcion) {
        this.pantDescripcion = pantDescripcion;
    }

    public Collection<PantRol> getPantRolCollection() {
        return pantRolCollection;
    }

    public void setPantRolCollection(Collection<PantRol> pantRolCollection) {
        this.pantRolCollection = pantRolCollection;
    }

    public Modulo getPantModulo() {
        return pantModulo;
    }

    public void setPantModulo(Modulo pantModulo) {
        this.pantModulo = pantModulo;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (pantNombre != null ? pantNombre.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Pantalla)) {
            return false;
        }
        Pantalla other = (Pantalla) object;
        if ((this.pantNombre == null && other.pantNombre != null) || (this.pantNombre != null && !this.pantNombre.equals(other.pantNombre))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "py.una.pol.ii.is2.dao.flota.Pantalla[pantNombre=" + pantNombre + "]";
    }

}
